package com.tian.excel.config;


import com.alipay.easysdk.kernel.Config;
import com.tian.excel.entity.prop.AliPayProperties;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: Tian
 * @version: 1.0
 * @since: 1.0
 * @date: 2024/8/4/15:27
 */
@Configuration
public class AlipayConfig {

    @Bean
    public Config config(AliPayProperties aliPayProperties){
        Config config = new Config();
        config.protocol=aliPayProperties.getProtocol();
        config.gatewayHost= aliPayProperties.getGatewayHost();
        config.signType= aliPayProperties.getSignType();
        config.appId= aliPayProperties.getAppId();
        config.merchantPrivateKey= aliPayProperties.getMerchantPrivateKey();
        config.alipayPublicKey= aliPayProperties.getAlipayPublicKey();
        //可设置异步通知接收服务地址(可选)
        config.notifyUrl= aliPayProperties.getNotifyUrl();
        config.encryptKey="";
        return config;

    }

}
